﻿
namespace System.Management.HyperV.Model.Msvm
{
    /// <summary>
    /// Represents the global settings for a virtual system. These settings do not change if a new snapshot is applied to the virtual system.
    /// </summary>
    /// <remarks>http://msdn.microsoft.com/en-us/library/cc136939(VS.85).aspx</remarks>
    public class VirtualSystemGlobalSettingData : CIM.VirtualSystemSettingData
    {
        #region Constructor
        internal protected VirtualSystemGlobalSettingData(ManagementObject wmiInstance)
            : base(wmiInstance)
        {
        }
        #endregion

        /// <summary>
        /// Any additional information provided to the recovery action. The meaning of this property is defined by the action in AutomaticRecoveryAction. If AutomaticRecoveryAction is 0 (None) or 1 (Restart), this value is NULL. If AutomaticRecoveryAction is 2 (Revert to Snapshot), this is the object path to a snapshot that should be applied on failure of the virtual machine worker process.
        /// </summary>
        public string AdditionalRecoveryInformation
        {
            get { return _dmo.AdditionalRecoveryInformation as string; }
        }
        /// <summary>
        /// Indicates whether SCSI commands from the guest operating system are passed to pass-through disks. It is recommended that SCSI filtering remains enabled for production deployments.
        /// </summary>
        public bool AllowFullSCSICommandSet
        {
            get { return (bool)_dmo.AllowFullSCSICommandSet; }
        }
        /// <summary>
        /// The action to be taken if the virtual machine worker process terminates abnormally. The default action is 1 (Restart).
        /// </summary>
        public ushort AutomaticRecoveryAction
        {
            get { return (ushort)_dmo.AutomaticRecoveryAction; }
        }
        /// <summary>
        /// The action to take when the host is shut down. The default action is 1 (Save State).
        /// </summary>
        public ushort AutomaticShutdownAction
        {
            get { return (ushort)_dmo.AutomaticShutdownAction; }
        }
        /// <summary>
        /// The action to be taken when the host is started. The default action is 1 ("Restart if Previously Running").
        /// </summary>
        public ushort AutomaticStartupAction
        {
            get { return (ushort)_dmo.AutomaticStartupAction; }
        }
        /// <summary>
        /// The time interval to wait before performing the startup action. By default, there is no delay.
        /// </summary>
        public string AutomaticStartupActionDelay
        {
            get { return _dmo.AutomaticStartupActionDelay as string; }
        }
        /// <summary>
        /// The channel identifier used to debug the virtual system using the VUD unified debugger.
        /// </summary>
        public uint DebugChannelId
        {
            get { return (uint)_dmo.DebugChannelId; }
        }
        /// <summary>
        /// The fully-qualified path to the root directory of an external data store. This store is managed by the virtual system management service and may contain private data from multiple virtual systems. This property may be specified only at the time the virtual machine is defined.
        /// </summary>
        public string ExternalDataRoot
        {
            get { return _dmo.ExternalDataRoot as string; }
        }
        /// <summary>
        /// The authorization scope to use in determining the access control policy for this virtual system.
        /// </summary>
        public string ScopeOfResidence
        {
            get { return _dmo.ScopeOfResidence as string; }
        }
        /// <summary>
        /// The fully-qualified path to the root directory of the external data store used to store snapshots for this virtual system. This store is managed by the virtual system management service and may contain private data from multiple virtual systems. Changes made to this property affect only snapshots taken subsequent to the change.
        /// </summary>
        public string SnapshotDataRoot
        {
            get { return _dmo.SnapshotDataRoot as string; }
        }
        /// <summary>
        /// The version of the virtual system in a format of "major.minor", for example "2.0".
        /// </summary>
        public string Version
        {
            get { return _dmo.Version as string; }
        }
    }
}
